package com.hcb.tonguetiphealth.global;

import java.io.File;

import android.app.Application;
import android.content.Context;
import android.os.Environment;

public class App extends Application { 
	private final String localPath = "/TongueTipHealth_LOG/";

	private CrashHandler crashHandler;
	
	public App(Context context) {
		
		try {
			File fileDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+ localPath);
			//fileDir.mkdir();
			File children[] = fileDir.listFiles() ;
			if(children.length >= 10) {
				for(int i=0; i<5; i++) {
					children[i].delete();
				}
			}
		} catch (Exception e) { 
		}
		
		crashHandler = CrashHandler.getInstance(); 
		crashHandler.init(context.getApplicationContext()); 
	}
	
}